﻿#ifndef ORDERMANAGEMODEL_H
#define ORDERMANAGEMODEL_H

#include <QAbstractTableModel>
#include "globalvars.h"
#include <QDate>

class OrderManageModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit OrderManageModel(QObject *parent = nullptr);

    virtual int rowCount(const QModelIndex &parent= QModelIndex()) const;
    virtual int columnCount(const QModelIndex &parent= QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    void refrushModel(DaySelect select);
    void setCustomizeDay(const QDate &start, const QDate &end);
    void setSelect(DaySelect select);
    const QString& getCheckInName(int row);
    const QString& getHouseType(int row);
    const QString& getReserveID(int row);
    const QString& getOrderState(int row);

private:
    DaySelect m_select;
    QDate m_startDay;
    QDate m_endDay;
    QStringList m_header;
    ReserveInfoList *m_reserveAllList;
    ReserveInfoList *m_reserveNoList;
};

#endif // ORDERMANAGEMODEL_H
